<template>
  <div>
      <button @click="showdiv">
          <p>{{buttfalg}}</p>
      </button>
      <div class="vshow" v-show="showfalg"></div>
  </div>
</template>

<script>
export default {
  name: 'Vshow',
  data() {
      return {
          showfalg: true,
          buttfalg: '隐藏'
      }
  },
  methods: {
      showdiv() {
          this.showfalg = !this.showfalg
          if (this.showfalg === true) {
              this.buttfalg = '隐藏'
          } else {
              this.buttfalg = '显示'
          }

      }
  }
}
</script>

<style scoped>
    .vshow {
        width: 200px;
        height: 200px;
        background-color: blueviolet
    }

</style>

